package com.goldgov.appdownload.web;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.goldgov.appdownload.service.AppDownloadBean;
import com.goldgov.appdownload.service.AppDownloadService;
import com.goldgov.kcloud.core.json.JsonSuccessObject;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/** 
 * @ClassName: AppDownloadController 
 * @Description: TODO
 * @author hanxiangyu
 * @date 2018年12月19日 上午10:25:45 
 */
@RestController
@RequestMapping("/workbench/appdownload")
@Api("app下载量统计")
public class AppDownloadController {
	
	
	@Autowired
	private AppDownloadService appDownloadService;
	
	@GetMapping("/findAndroidAndIOSDownloadNum")
	@ApiOperation(value = "统计app数量", notes = "新增或更新app信息" )
	public JsonSuccessObject<AppDownloadBean> findAndroidAndIOSDownloadNum(HttpServletRequest request){
		AppDownloadBean bean = appDownloadService.findAndroidAndIOSDownloadNum();
		JsonSuccessObject<AppDownloadBean> returnResult = new JsonSuccessObject<AppDownloadBean>(bean);
		return returnResult;
	}
	
	
	
//	@GetMapping("/saveOrUpdateAppDownload")
//	@ApiOperation(value = "新增或更新app信息", notes = "新增或更新app信息" )
//	public void saveOrUpdateAppDownload(AppDownload appDownload,HttpServletRequest request,
//			HttpServletResponse response) {
//		if (PropertyUtil.objectNotEmpty(appDownload.getDeviceId())) {
//			appDownloadService.saveOrUpdateAppDownload(appDownload);
//		}
//	}
	
	
}
